package com.example.common.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author zjarlin
 * @since 2023/4/16 09:07
 */
public class SpringBeanUtil {

    public static <T> T getBean(Class<T> tClass) {
        ApplicationContext context = new ClassPathXmlApplicationContext("classpath:application.xml");
        return context.getBean(tClass);
    }

}
